<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>login</title>
		<script type="text/javascript" src="../js/vue.js"></script>
		<script type="text/javascript" src="../js/jquery-1.4.1.js"></script>
		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	</head>
	<style type="text/css">
		#main{
			margin: 200px 800px;
		}
		.float-left{
			float: left;
		}
		.row{
			margin-top: 20px;
		}
		#mima{
			margin-left: 30px;
		}
		#yhm{
			margin-left: 15px;
		}
		#dl{
			margin-left: 110px;
		}
	</style>
	<script>
		window.onload = function() {
			var vue = new Vue({
				el: '#main',
				data: {
					username:'',
					password:''
				},
				methods: {
					login() {
						console.log(this.username)
						var username=this.username
						console.log(this.password)
						var password=this.password
						axios.get('http://localhost:8080/attendance-service/wwx/user/get?method=login&username='+username+'&password='+password).then(
							function(backdatas) {
								console.log(backdatas)
								var roledata = backdatas.data;
								if(roledata.code==200){
									/* window.location.href="show-role.html"; */
								}else{
									/* window.location.href="404.html"; */
								}
								console.log(vue.roleList)
							})
					},
				},
			});
			}
	</script>
	<body>
		<!-- <input type="text" class="num" :value='item.num' v-on:blur='changeNum(item.id, $event)'/>
		changeNum: function(id, event){console.log(id, event.target.value);} -->
		<div id=main>
			<div class="row">
				<div id="username" class="float-left" >用户名:</div>
				<div><input type="text" id="yhm" v-model="username" value="13112946054"></div>
			</div >
			<div class="row">
				<div id="password" class="float-left">密码:</div>
				<div><input type="password" id="mima" v-model="password" value="123456"></div>
			</div>
			<div class="row"><input type="button" v-on:click="login" value="登录" id="dl"></div>
		</div>
	</body>
	
</html>
